﻿using NUnit.Framework;

namespace Iowa.Infrastructure.Test.Test_PersonRepository
{
  [TestFixture]
  public class Test_People_Update : Test_People_Base
  {
    [Test]
    public void I_Wanna_Update_A_Person_Already_In_The_System()
    {
      // insert
      var tmp = InsertPerson();
      // get by id
      var repo = new PersonRepository();
      var person = repo.GetById(EntityId);
      // update
      const string lex = "Lex";
      const string luthor = "Luthor";
      person.Firstname = lex;
      person.Surname = luthor;
      // commit
      tmp = repo.UpdatePerson(person);
      // get by id
      person = repo.GetById(EntityId);
      // verify new first/last pair
      Assert.AreEqual(lex, person.Firstname);
      Assert.AreEqual(luthor, person.Surname);
    }
  }
}
